home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / autolib / create_auto_textsw_window.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  959 b   |  38 lines

  1. /*
  2. ### create auto text window ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6. #include <suntool/panel.h>
  7. #include <suntool/textsw.h>
  8.  
  9.  
  10. void create_auto_textsw_window()
  11. {
  12.  
  13.     extern Frame auto_frame;
  14.     extern Textsw auto_textsw;
  15.     extern Textsw_status auto_status; 
  16.     extern char string[],string2[],auto_dir_name[],auto_file_name[],auto_input_name[];
  17.  
  18.         sprintf(string,"%s/%s",auto_dir_name,auto_input_name);
  19.         auto_textsw = window_create(auto_frame, TEXTSW,
  20.         0);
  21.     if(auto_textsw == NULL){
  22.         system_mess_proc(1,"No more windows. Clean up some windows to make room.");
  23.         (void) destroy_auto_windows();
  24.         return;
  25.     }
  26.         window_set(auto_textsw,
  27.                 TEXTSW_STATUS, &auto_status,
  28.                 TEXTSW_FILE,string,
  29.                 TEXTSW_FIRST,0,
  30.                 0);
  31.         if(auto_status == TEXTSW_STATUS_CANNOT_OPEN_INPUT){
  32.                 sprintf(string2,"File (%s) does not exist!\n",string);
  33.         system_mess_proc(1,string2);
  34.         }       
  35.  
  36. }
  37.  
  38.